package com.ticket.sass.provider.controller;


import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.ticket.sass.provider.business.CinemaBusiness;
import com.ticket.sass.provider.business.impl.CinemaBusinessImpl;
import com.ticket.sass.provider.dto.cinema.CinemaListInput;
import com.ticket.sass.provider.dto.cinema.CinemaListOutput;
import com.ticket.sass.provider.model.ResultModel;
import com.ticket.sass.provider.service.PageModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


/**
 * 影院控制层
 * @author ywb
 * @date 2021-11-25 14:44
 */
@RestController
@ApiSupport(order = 999)
@Api(tags = {"总店影院数据-模块"})
@RequestMapping("/cinemas")
public class CinemaController {
    
    final CinemaBusiness business;
    
    public CinemaController(CinemaBusinessImpl business) {
        this.business = business;
    }
    
    @GetMapping
    @ApiOperation("影院列表")
    public ResultModel<PageModel<CinemaListOutput>> getCinema(
        @Valid CinemaListInput input
    ) {
        return ResultModel.success(
            business.list(input)
        );
    }
}